conf = [1; 0.1; 0.3; 0.00025; 0.1; 4; 4];
vert = [-1; -1; -1; 1; 1; 1; 1; -1];
edge = [0; 1; 1; 2; 2; 3; 3; 0];

    
[oconf, overt, oedge] = ElTopoWraper(conf, vert, edge);

% axis ( [ -2, 2, -2, 2 ] );
%     axis manual;
%     hold on
%     
    
    
%     plot(overt(1:2:oconf(1)*2), overt(2:2:oconf(1)*2));


for frame = 1 : 55520
    
    vec = zeros(2*oconf(1), 1);
    
    for i = 1 : oconf(1)
        zn = [overt(2*i-1); overt(2*i); 0];
        zu = [0; 0; 1];
        zt = cross(zu, zn);
        
        zl = norm(zn);
        zt = zt * exp(zl)^2;
        
        vec(2*i-1 : 2*i) = zt(1:2);
    end
    
    [oconf, overt, oedge] = ElTopoWraper([0; oconf(1); 0.0005], vec);
    
    clf
    axis ( [ -3, 3, -3, 3 ] );
    axis square;
    hold on
    
    for i = 1 : oconf(2)       
        line([overt((oedge(i*2-1)+1)*2-1);overt((oedge(i*2)+1)*2-1)],[overt((oedge(i*2-1)+1)*2),overt((oedge(i*2)+1)*2)])
    end
    
    getframe();
    hold off
    
    frame
end

